package com.tuo51.foudation.constant;

import lombok.Setter;


public class SaleFAQConstant {
	
	public static final String LEADER = "ROLE_GARDEN_LEADER"; 
  
    public enum SaleFAQType{
        TO_AUDIT(0, "待审核"),
        APPROVED(1, "已审核"),
        REFUSED(2, "已拒绝"),
        ;
    	
        @Setter
        private Integer code;

        @Setter
        private String value;

        SaleFAQType(int code, String value){
            this.code = code;
            this.value = value;
        }

        public int codeOf(){
            return code;
        }

        public String valueOf(){
            return value;
        }

        public SaleFAQType get(int code){
            for (SaleFAQType type : values()) {
                if (type.codeOf()==code)
                    return type;
            }
            return null;
        }

        public SaleFAQType getValueOf(String value){
            for (SaleFAQType type : values()) {
                if (value.contains(type.valueOf()))
                    return type;
            }
            return null;
        }
    }
   
}
